import { defineStore } from 'pinia';
import { ref } from 'vue';
 
export const useUserStore = defineStore('user', () => {
  const userInfo = ref({
    name: 'John Doe',
  }); // 假设用户信息是一个对象
 
  function setUserInfo(info: any) {
    userInfo.value = info;
  }
  
//   清空用户信息
  function clearUserInfo() {
    userInfo.value = { name: '' };
  }
 
  return { userInfo, setUserInfo, clearUserInfo };
});